/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: zhongyisheng
 * Date: 2024-05-06
 * Time: 16:57
 */
public class Test {
    public static void myToString(int[] array) {
        System.out.printf("[");
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]);
            if(i!=array.length-1)
                System.out.print(",");
        }
        System.out.printf("]");
    }
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5};
        myToString(array);
        System.out.println();
    }
}
